package com.longrise.co.ui.login.contract;

import com.longrise.LEAP.Base.Objects.EntityBean;
import com.longrise.co.ui.login.model.ImageValidateCode;
import com.longrise.co.ui.login.model.LoginBean;
import com.longrise.co.ui.login.model.RegisterBean;
import com.longrise.co.ui.login.model.SmsCodeBean;
import com.ly.common.base.BaseModel;
import com.ly.common.base.BasePresenter;
import com.ly.common.base.BaseView;

import rx.Observable;

/**
 * Created by luoyang on 2017-6-22.
 */

public interface LoginContract {

     interface View<T> extends BaseView {
        void requestSuccess(T t);
    }

     interface RegisterView extends View {
        void sendSmsSuccess(SmsCodeBean bean);
         void getImageValidateCodeSuccess(ImageValidateCode bean);
    }

     interface Model extends BaseModel {
        Observable<SmsCodeBean> sendSms(EntityBean bean);

        Observable<LoginBean> login(EntityBean bean);

         Observable<RegisterBean> register(EntityBean bean);

         Observable<String> resetPwd(EntityBean bean);

         Observable<ImageValidateCode> getImageCode();

    }

     abstract class Presenter extends BasePresenter<View , Model> {
         public abstract void sendSmsRequest(String mobilePhone, String type);

         public abstract void loginRequest(String userFlag, String password);

         public abstract void registerRequest(String userFlag, String mobile, String smsCode, String pwd, String rePwd, boolean isCheck, String imageCode, String imageId);

         public abstract void resetPwdRequest(String mobile, String password);

         public abstract void imageCodeRequest();
    }
}
